Hi, my self Ravi Vishwakarma. I have completed my studies at SPICBB Varanasi. now I completed MCA with 76% form Veer Bahadur Singh Purvanchal University Jaunpur.
SWE @ MindStick | Software Engineer | Web Developer | .Net Developer | Web Developer | Backend Engineer | .NET Core Developer
Access modifiers : In c#, the access modifier 'public', 'private' and 'protected' are used to access data members and methods of class. With the use of access modifier we access methods and variables of a class like as-
1- Public: Public access modifier provide facilities to access methods properties and fields of base class in derived class or in other file in project.
2- Private: Private access modifier did not allow to access properties, methods and fields of base in other derived class. Which methods or variables declare as private then we can use them within same class.
3- Protected: Protected access modifiers provide facility to access methods, properties and fields of base class within same class or its derived class only.
Liked By
Write Answer
What is the difference between public, private, and protected access modifiers?
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
Ashutosh Kumar Verma
26-Aug-2021Access modifiers : In c#, the access modifier 'public', 'private' and 'protected' are used to access data members and methods of class. With the use of access modifier we access methods and variables of a class like as-
1- Public: Public access modifier provide facilities to access methods properties and fields of base class in derived class or in other file in project.
2- Private: Private access modifier did not allow to access properties, methods and fields of base in other derived class. Which methods or variables declare as private then we can use them within same class.
3- Protected: Protected access modifiers provide facility to access methods, properties and fields of base class within same class or its derived class only.